package com.wwt.blog.imp;

import com.wwt.blog.mapper.CategoryMapper;
import com.wwt.blog.pojo.Category;
import com.wwt.blog.service.CategoryService;
import com.wwt.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImp implements CategoryService {
    @Autowired
    CategoryMapper categoryMapper;
    @Override
    public Category getCategory(Integer id) {
        return categoryMapper.selectById(id);
    }

    @Override
    public Result finfAllCateforys() {
        List<Category> categories = categoryMapper.selectList(null);
        return Result.result_success(categories);
    }
}
